<template>
	
	<view style="height: 100%;width: 100%;">
<view style="width: 100%;flex-direction: row;display: flex;align-items:center; justify-content: center;">
<tui-circular-progress :percentText=onlineText progressColor="#EB0909" fontColor="#EB0909" :percentage="70" diam="100" class=" margin-right: 10%;"></tui-circular-progress>
<tui-circular-progress :percentText=relayText progressColor="#19be6b" fontColor="#19be6b" :percentage="70" diam="100" class=" margin-left: 10%;"></tui-circular-progress>
<tui-circular-progress :percentText=syncedText progressColor="#EB0909" fontColor="#EB0909" :percentage="70" diam="100" class=" margin-left: 10%;"></tui-circular-progress>
</view>

<!-- 卡片 -->
<tui-divider dividerColor="red" gradual>日收益</tui-divider>
<view style="width: 100%;flex-direction: row;display: flex;align-items:center; justify-content: center;">{{analyze.RewardTotal}} HNT</view>
<tui-divider dividerColor="red" gradual>周收益</tui-divider>
<view style="width: 100%;flex-direction: row;display: flex;align-items:center; justify-content: center;">{{analyze.RewardTotalWeek}} HNT</view>
<tui-divider dividerColor="red" gradual>月收益</tui-divider>
<view style="width: 100%;flex-direction: row;display: flex;align-items:center; justify-content: center;">{{analyze.RewardTotalMonth}} HNT</view>
<tui-divider dividerColor="red" gradual>总收益</tui-divider>
<view style="width: 100%;flex-direction: row;display: flex;align-items:center; justify-content: center;">{{analyze.RewardTotalTotal}} HNT</view>
<tui-divider dividerColor="red" gradual>单设备平均总收益</tui-divider>
<view style="width: 100%;flex-direction: row;display: flex;align-items:center; justify-content: center;">{{analyze.RewardAvgTotal}} HNT</view>
<tui-tabbar :current="current"  backdropFilter :backgroundColor="backgroundColor" :tabBar="tabBar" color="#777" selectedColor="#AC9157" @click="tabbarSwitch"></tui-tabbar>
<!-- <tui-footer copyright="Power By Wikig"></tui-footer> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabBar: [
					{
						pagePath: '../dashboard/dashboard',
						text: 'Dashboard',
						iconPath: '../../static/images/tabbar/code_gray.png',
						selectedIconPath: '../../static/images/tabbar/code_active.png'
					},
					{
						pagePath: '../addhotspot/addhotspot',
						text: 'Add',
						iconPath: '../../static/images/tabbar/release.png',
						hump: true,
						selectedIconPath: '../../static/images/tabbar/release.png'
					},
					{
						pagePath: '../listhotspot/listhotspot',
						text: 'Hotspot List',
						iconPath: '../../static/images/tabbar/code_gray.png',
						selectedIconPath: '../../static/images/tabbar/code_active.png',
					}
				],
				"analyze":{
					
				},
				"online":"",
				"onlineText":"Online:",
				"relay":"",
				"relayText":"Relay:",
				"synced":"",
				"syncedText":"Synced:",
			}
		},
		methods: {
				
			tabbarSwitch(e){
			console.log(e);
				uni.navigateTo({
				    url: e.pagePath,
				})
			},
			onShow(){
				console.log("老子load了")
				this.$data.analyze = getApp().globalData.analyz;
					
				if(this.$data.analyze.BasicNum>0){
					
					this.$data.online = this.$data.analyze.OnlineNumber/this.$data.analyze.BasicNum;
					this.$data.relay = this.$data.analyze.Relay/this.$data.analyze.BasicNum;
					this.$data.synced = this.$data.analyze.Synced/this.$data.analyze.BasicNum;
				}

				this.$data.onlineText =this.$data.onlineText+ this.$data.analyze.OnlineNumber + "/" + this.$data.analyze.BasicNum;
				
				this.$data.relayText = this.$data.relayText+this.$data.analyze.Relay + "/" + this.$data.analyze.BasicNum;
				this.$data.syncedText = this.$data.syncedText+this.$data.analyze.Synced + "/" + this.$data.analyze.BasicNum;
				
				console.log(this.$data.analyze)
			}
		}
	}
</script>

<style>

</style>
